/* Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
  <file> uls_log.h </file>
  <brief>
    A part of logging framework of ULS.
    This file is part of ULS, Unified Lexical Scheme.
  </brief>
  <author>
    Stanley J. Hong <babel96@gmail.com>, August 2011.
  </author>
*/

#ifndef __ULS_LOG_H__
#define __ULS_LOG_H__

#include "uls_lex.h"
#include "uls_print.h"
#include <stdarg.h>
#include <wchar.h>

#ifdef __cplusplus
extern "C" {
#endif

void uls_set_syserr(uls_lex_t* uls, void* data, uls_lf_puts_t proc);

void uls_vlog(uls_lex_t* uls, const uls_lf_char_t* fmt, va_list args);
void uls_log(uls_lex_t* uls, const uls_lf_char_t* fmt, ...);
void uls_panic(uls_lex_t* uls, const uls_lf_char_t* fmt, ...);

void uls_vwlog(uls_lex_t* uls, const wchar_t* wfmt, va_list args);
void uls_wlog(uls_lex_t* uls, const wchar_t* wfmt, ...);
void uls_wpanic(uls_lex_t* uls, const wchar_t* wfmt, ...);

void err_puts(const uls_lf_char_t* mesg);
void err_log_puts(const uls_lf_char_t* mesg);
void err_panic_puts(const uls_lf_char_t* mesg);

void err_vlog(const uls_lf_char_t* fmt, va_list args);
void err_log(const uls_lf_char_t* fmt, ...);
void err_panic(const uls_lf_char_t* fmt, ...);

void err_wputs(const uls_lf_word_t* wmsg);
void err_vwlog(const uls_lf_word_t* wfmt, va_list args);
void err_wlog(const uls_lf_word_t* wfmt, ...);
void err_wpanic(const uls_lf_word_t* wfmt, ...);

#ifdef __cplusplus
}
#endif

#endif
